package com.sweet.fourtimeoa.mapper;

import com.sweet.fourtimeoa.pojo.dto.DocumentList;
import com.sweet.fourtimeoa.pojo.dto.SystemUserQueryDto;
import com.sweet.fourtimeoa.pojo.entity.Departments;
import com.sweet.fourtimeoa.pojo.entity.OperationLogs;
import com.sweet.fourtimeoa.pojo.entity.Roles;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SystemMapper {
    //角色管理_查询
    List<Roles> queryRolesList();
    //角色管理_添加
    void insertRoles(String roleName1);
    //角色管理_删除
    void deleteRoles(Integer roleId);
    //角色管理_修改
    void updateRoles(Roles roles);
    //角色管理_修改_获取数据
    Roles getByUpdateRoles(Integer roleId);

    //新增日志
    void addLog(OperationLogs log);

    //获取所有部门节点
    @Select("select parent_id from departments GROUP BY parent_id")
    List<Integer> getAllParentId();

    // 根据父节点查询部门
    @Select("select * from departments where parent_id = #{parentId}")
    List<Departments> getDepartmentsByParentId(Integer parentId);
    // 根据id查询部门
    @Select("select * from departments where id = #{id}")
    Departments getDepartmentsById(Integer idd);

    void updateDepartments(Departments departments);

    void insertDepartment(Departments departments);

    @Delete("delete from departments where id = #{id}")
    void deleteDepartment(Integer id);
}
